Macromedia Flex Article

Learning Flex Basics (Part 3) : Working with Containers


Robert Crooks

Robert Crooks

Macromedia Training

Table of Contents

  1. Introduction
  2. Building the Containers
  3. Create the Application Object
  4. Create a Data Array
  5. Add a TabNavigator Container for Global Navigation
  6. Add an HBox and Panel Containers for Main Views
  7. Add a ViewStack, LinkBar, and Panel Containers for Secondary Views
  8. Add a Form Container
  9. Add a Tile Layout Container and Populate It Using a Repeater
  10. Create a Pseudo Bar Chart Using a Repeater and VBoxes
  11. Complete Code Listing for containers.mxml
  12. Where to Go from Here

In this tutorial you will work with navigation and layout containers to create an application with multiple views. You learn to use several layout containers and the Repeater class, which iterates over an array of data. You also learn how to handle events for items that a Repeater class generates.

This tutorial is the third part in a four-part series written by Robert Crooks of the Macromedia Customer Training group:

If you prefer, you can download the entire set of tutorials.

If you like what you see and want to get more experience with Flex, Macromedia Customer Training offers Fast Track to Macromedia Flex, a two-day onsite training course to jump-start Flex development in your organization. Now let's get started!

What you will learn

  1. How to use the Application tag.
  2. How to use the TabNavigator.
  3. How to use the ViewStack.
  4. How to use the LinkBar.
  5. How to use a Panel container.
  6. How to use the HBox.
  7. How to use the VBox.
  8. How to use the Form container.
  9. How to use the Tile container.
  10. How to use the Repeater class.
  11. How to use Label controls.
  12. How to use Button controls.
  13. How to create an array in ActionScript.
  14. How to create event handlers for events on repeated items in ActionScript.

Requirements

To complete this tutorial you will need to install the following software and files:

Macromedia Flex

(Installed and running on any server and platform supported by Flex. Note that the Flex trial is available on CD from the Macromedia store for $8.99. To learn more about the Flex trial, please read the Flex Frequently Asked Questions.)

Dreamweaver MX 2004 or a text editor that you can use to write XML and ActionScript code (a basic text editor such as Notepad is adequate)

Solution files for the tutorial:

Prerequisite knowledge:



About the author

Robert Crooks is the Director of Curriculum Development for Macromedia. He has written several courses on creating internet applications including the beta version of Fast Track to Macromedia Flex.